/*#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
	int x1, x2, x3, sum = 0, ans,n;
	char b, x4;
	scanf("%d", &n);
	while (n) {

		scanf("%d-%d-%d-%c", &x1, &x2, &x3, &x4);
		sum = x1 + x2 / 100 * 2 + x2 % 100 / 10 * 3 + x2 % 10 * 4 + x3 / 10000 * 5 + x3 % 10000 / 1000 * 6 + x3 % 1000 / 100 * 7 + x3 % 100 / 10 * 8 + x3 % 10 * 9;
		ans = sum % 11;
		if (ans == 10)
			b = 'X';
		else
			b = ans + '0';
		if (b == x4)
		
			printf("Right\n");
		
		else
			printf("%d-%03d-%05d-%c\n", x1, x2, x3, b);
		n--;
	}
	return 0;
}*/